Repository navigation
ci(docs): deploy cloudhal.dev on push to main (#236) - #242
Merged
Merged
Conversation
RFC-0037: a push to main deploys the cloudhal-dev Worker. The Docs deploy workflow builds apps/docs and runs wrangler deploy when something the site is built from changes (apps/docs, docs, the contract schemas, the CLI help that the reference is generated from, security/, the lockfile, the workflow), and on workflow_dispatch. - The docs-deploy environment (main only) holds CLOUDFLARE_API_TOKEN as a secret and CLOUDFLARE_ACCOUNT_ID as a variable; until both exist the job skips with a notice. - The token reaches the deploy step only, after the install; the GitHub token is read-only; actions are pinned by SHA; one deploy at a time; repository guard. - A test keeps the triggers, pins, permissions, token placement and skip, and checks the paths against what the docs build reads. - The key runbook and RFC-0046/0037 say the deploy is automatic now. Closes #236 Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Madraka <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Owner steps (after review; nothing here has been created)
The
docs-deployenvironment already exists, with deployment branchesmainonly. Until both values below exist, the workflow skips with a notice, so this PR can merge first.cloudhal-dev.cloudhal.dev.gh secret set CLOUDFLARE_API_TOKEN --env docs-deploy -R cloudhal-dev/cloudhal, then paste the token when prompted.gh variable set CLOUDFLARE_ACCOUNT_ID --env docs-deploy -R cloudhal-dev/cloudhal --body <account id>.main).cloudhal.dev,custom_domain: true), add Zone › Workers Routes › Edit for thecloudhal.devzone to the token, and run it again.What
RFC-0037: "a push to
maindeployscloudhal-dev"..github/workflows/docs-deploy.yml:Triggers: a push to
mainthat touches anything the site is built from, andworkflow_dispatch. The paths are:apps/docs/**: the site, its Worker and its build scripts;docs/**: every page;packages/core-contracts/schemas/**:/schemas/v1/*, copied byscripts/postbuild.ts;packages/cli/src/cli/help.ts: the generated CLI reference, built bysrc/lib/reference.ts;security/**:/.well-known/cloudhal/keys.jsonand its.sig;pnpm-lock.yaml: the Astro, Starlight and wrangler versions;yanked.jsonneeds no deploy, because the Worker serves it live from theyank-listbranch.One job,
deploy, in thedocs-deployenvironment:permissions: {}, andcontents: readon the job;if: github.repository == 'cloudhal-dev/cloudhal';concurrency: docs-deploywithcancel-in-progress: false, so a newer push waits instead of cutting off an upload;yank-list.yml; checkout withpersist-credentials: false.Steps:
CLOUDFLARE_API_TOKENandCLOUDFLARE_ACCOUNT_IDexist. If either is missing, emit a notice and a job summary, and run no other step.pnpm install --frozen-lockfile. The install runs without the token.pnpm --filter @cloudhal/docs run deploy, which isastro build, thenpostbuild, thenwrangler deploy. This is the only step that gets the token.Test:
packages/cli/test/docs-deploy-workflow.test.ts(5 tests) covers:postbuild.tsandreference.tssources);: writeanywhere;Docs: the key runbook's step 9, RFC-0046 §9 and RFC-0037 now say the deploy is automatic.
Checks
actionlintis clean.pnpm --filter @cloudhal/docs run buildfrom a plain install builds 129 pages, 25 schemas andkeys.json. No other package build is needed.docs-deploy-workflow5,yank-list-workflow6,release-workflows14, core-contractsrelease-schemas23, docs 41.Closes #236
🤖 Generated with Claude Code